﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Templates_Testamonials_Default : BaseTemplatePage
{
    protected override void AttachEvents()
    {
    }

    protected override void OnInit(EventArgs e)
    {
        if (!IsPostBack)
        {
            if (User == null || !User.HasAdminRights())
            {
                if (AcmsContext.CurrentPost.Parent.Parent != null)
                {
                    Response.Redirect(AcmsContext.CurrentPost.Parent.Parent.Url);
                }
                else
                {
                    Response.Redirect(AcmsContext.CurrentPost.Parent.Url);
                }
            }
        }
        ucTestamonialsModule.DataRequired += new EventHandler(ucTestamonialsModule_DataRequired);
        base.OnInit(e);
    }

    void ucTestamonialsModule_DataRequired(object sender, EventArgs e)
    {
        ucTestamonialsModule.DataSource = new List<Acms.Bll.Post>();
        ucTestamonialsModule.DataSource.Add(AcmsContext.CurrentPost);
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DataBind();

        }
    }
}
